// DlgSplitBlock.cpp : implementation file
//

#include "stdafx.h"
#include "MotionControlSoftware.h"
#include "DlgSplitBlock.h"
#include "afxdialogex.h"


// CDlgSplitBlock dialog

IMPLEMENT_DYNAMIC(CDlgSplitBlock, CDialogEx)

CDlgSplitBlock::CDlgSplitBlock(CWnd* pParent /*=NULL*/)
	: CDialogEx(CDlgSplitBlock::IDD, pParent)
	, m_dSplitSizeX(0)
	, m_dSplitSizeY(0)
	, m_iEnalbeSplitGraph(0)
{

}

CDlgSplitBlock::~CDlgSplitBlock()
{
}

void CDlgSplitBlock::DoDataExchange(CDataExchange* pDX)
{
	CDialogEx::DoDataExchange(pDX);
	DDX_Text(pDX, IDC_EDIT_SPLITSIZEX, m_dSplitSizeX);
	DDX_Text(pDX, IDC_EDIT_SPLITSIZEY, m_dSplitSizeY);
	DDX_Check(pDX, IDC_CHECK_ENABLESPLIT, m_iEnalbeSplitGraph);
}


BEGIN_MESSAGE_MAP(CDlgSplitBlock, CDialogEx)
	ON_BN_CLICKED(IDOK, &CDlgSplitBlock::OnBnClickedOk)
	ON_BN_CLICKED(IDC_CHECK_ENABLESPLIT, &CDlgSplitBlock::OnBnClickedCheckEnablesplit)
END_MESSAGE_MAP()


// CDlgSplitBlock message handlers


void CDlgSplitBlock::OnBnClickedOk()
{
	// TODO: Add your control notification handler code here
	UpdateData(TRUE);
	CDialogEx::OnOK();
}


BOOL CDlgSplitBlock::OnInitDialog()
{
	CDialogEx::OnInitDialog();

	// TODO:  Add extra initialization here
	UpdateData(FALSE);
	return TRUE;  // return TRUE unless you set the focus to a control
	// EXCEPTION: OCX Property Pages should return FALSE
}


void CDlgSplitBlock::OnBnClickedCheckEnablesplit()
{
	// TODO: Add your control notification handler code here
	UpdateData(TRUE);
	if (m_iEnalbeSplitGraph == 1)
	{
		GetDlgItem(IDC_EDIT_SPLITSIZEX)->EnableWindow(TRUE);
		GetDlgItem(IDC_EDIT_SPLITSIZEY)->EnableWindow(TRUE);
	}
	else
	{
		GetDlgItem(IDC_EDIT_SPLITSIZEX)->EnableWindow(FALSE);
		GetDlgItem(IDC_EDIT_SPLITSIZEY)->EnableWindow(FALSE);
	}
}
